package com.rongxue.service.Impl;

import com.rongxue.mapper.SMessagePersonalMapper;
import com.rongxue.mapper.SSuggestMapper;
import com.rongxue.pojo.Message;
import com.rongxue.pojo.MessagePersonal;
import com.rongxue.pojo.Question;
import com.rongxue.service.ConsultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by yangweijian on 2018/1/22.
 */
@Service
@Transactional
public class ConsultServiceImpl implements ConsultService {

    @Autowired
    private SSuggestMapper sSuggestMapper;

    @Autowired
    private SMessagePersonalMapper sMessagePersonalMapper;
    @Override
    public void insertSuggest(Map<String, Object> map) {
        sSuggestMapper.insertSuggest(map);
    }

    @Override
    public List<MessagePersonal> selectMessagePersonalByUserId(String userId) {
        return sMessagePersonalMapper.selectMessagePersonalByUserId(userId);
    }

    @Override
    public List<Message> selectMessageList() {
        return sMessagePersonalMapper.selectMessageList();
    }

    @Override
    public List<Question> selectQestionList() {
        return sMessagePersonalMapper.selectQestionList();
    }

    @Override
    public void updateIsReadByid(String id) {
        sMessagePersonalMapper.updateIsReadByid(id);
    }
}
